package cn.ppool.xmlmapper.builder.parse.model.base;

import cn.ppool.xmlmapper.builder.MapperBuilder;
import cn.ppool.xmlmapper.builder.xml.XNode;

import java.util.List;
import java.util.Map;

public abstract class BaseFuncBO extends BaseBo {

    /**
     * 生成代码
     */
    public abstract String complieEntity(Map<String, Object> allVar, Map<String, Object> sqlVar, StringBuilder sql, BaseFuncBO lastObject);

    protected XNode currentNode;
    protected XNode parentNode;
    protected List<BaseFuncBO> body;

    private String content;

    public BaseFuncBO(MapperBuilder configure, XNode parentNode, XNode currentNode) {
        super(configure);
        this.parentNode = parentNode;
        this.currentNode = currentNode;
        this.content = currentNode.getStringBody();
        body = super.buildModel(configure,parentNode, currentNode);
    }

    protected String getContent(Map<String, Object> allVar, Map<String, Object> sqlVar) {
        return parseVariable(this.content, allVar, sqlVar);
    }


}
